import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
  selector: 'app-article',
  templateUrl: './article.component.html',
  styleUrls: ['./article.component.scss']
})
export class ArticleComponent implements OnInit {
  aid:string;
  article:Object;
  constructor(private route: ActivatedRoute) { }

  ngOnInit() {
  
      this.route.params.subscribe((params) =>{       
        this.aid = params['aid']?params['aid']:'0';
      });

      this.article =  {
        id: 123,
        title: '我的博客开通啦',
        prevText: '今天我的博客开始写页面啦,这个是angular写的',
        keywords: ['博客', 'angular'],
        addtime: '2018-05-26',
        viewCount: 159,
        prevImg: '../../assets/img/11.jpg',
        content:'我的博客开通啦,今天我的博客开始写页面啦,这个是angular写的'
      }
   
  }

}
